import instance from '../../utils/axios.js'

//导入token，js的包
import { getToken } from '../../utils/token.js'

//放置与用户相关的接口
function getlogin( {mobile,code} ){
    return instance({
        url:'/v1_0/authorizations',
        method:'post',
        data:{
            mobile:mobile,
            code:code
        }
    })
}

export { getlogin }

//放置登录接口
const getUserInfo = function(){
    return instance({
        url:'/v1_0/user/profile',
        method:'get',
        //调用方法 获取返回的对象 然后 点出token值
        headers:{
            Authorization:`Bearer ${getToken().token}`
        }
    })
}

export { getUserInfo }
